<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <base href="#(basePath)"/>
    <title>收款单详情</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="static/layui/css/layui.css" media="all">
</head>
<body>
<div class="layui-fluid">

    <div class="layui-card">
        <div class="layui-card-header">收款单信息(请发给打款人) </div>
        <div class="layui-card-body layui-text">
            <table class="layui-table">
                <colgroup>
                    <col width="100">
                    <col>
                </colgroup>
                <tbody>
                <tr>
                    <td>订单号</td>
                    <td>#(order.merchOrderNo)(请打款人一定要在转账时填写此订单号到备注)</td>
                </tr>
                <tr>
                    <td>金额</td>
                    <td>#(order.amountShow)</td>
                </tr>
                <tr>
                    <td>金额大写</td>
                    <td>#(order.amountBigHZ)</td>
                </tr>
                <tr>
                    <td>打款人</td>
                    <td>#(order.debtor)</td>
                </tr>
                <tr>
                    <td>打款人手机</td>
                    <td>#(order.phoneNo)</td>
                </tr>
                <!--<tr>-->
                <!--<td>更新时间</td>-->
                <!--<td>#(merch.createTime)</td>-->
                <!--</tr>-->
                </tbody>
            </table>
        </div>
    </div>

    <div class="layui-card">
        <div class="layui-card-header">收款单信息(请发给打款人) </div>
        <div class="layui-card-body layui-text">
            <table class="layui-table">
                <colgroup>
                    <col width="100">
                    <col>
                </colgroup>
                <tbody>
                <tr>
                    <td>收款户名</td>
                    <td>#(card.customerName)</td>
                </tr>
                <tr>
                    <td>收款账号</td>
                    <td>#(card.cardNo)</td>
                </tr>
                <tr>
                    <td>收款银行</td>
                    <td>#(card.bankName)</td>
                </tr>
                <tr>
                    <td>收款商户</td>
                    <td>#(merch.code)-#(merch.name)</td>
                </tr>
                <tr>
                    <td>联系人</td>
                    <td>#(merch.name)</td>
                </tr>
                <tr>
                    <td>联系电话</td>
                    <td>#(card.phoneNo)</td>
                </tr>
                <!--<tr>-->
                <!--<td>更新时间</td>-->
                <!--<td>#(merch.createTime)</td>-->
                <!--</tr>-->
                </tbody>
            </table>
        </div>
    </div>

</div>
<script src="static/layui/layui.js"></script>
<script src="static/menoy.js"></script>
<script>
    layui.config({
        base: '#(basePath)' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'upload'], function(){
        var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
        var upload = layui.upload;
        //执行实例
        var uploadInst = upload.render({
            elem: '#payfile' 												// 绑定元素
            ,url: '#(basePath)merch/payorder/batchPay'	// 上传接口
            //,field:''															// 设定文件域的字段名
            ,data: {payPassword: function(){ return layui.$('#payPassword').val(); }}	// 请求上传接口的额外参数
            ,accept: "file"												// 指定允许上传时校验的文件类型，可选值有：images（图片）、file（所有文件）、video（视频）、audio（音频）
            ,auto: false	// 是否选完文件后自动上传。如果设定 false，那么需要设置 bindAction 参数来指向一个其它按钮提交上传
            ,bindAction:'#submitBtn'// 指向一个按钮触发上传，一般配合 auto: false 来使用。值为选择器或DOM对象，如：bindAction: '#btn'
            ,done: function(res){
                //上传完毕回调
                if(res.code == 0){
                    parent.layer.msg(res.msg, {icon:1});
                    parent.layer.close(index); //执行关闭
                    parent.location.reload();
                }else{
                    parent.layer.msg(res.msg, {icon:2});
                }
            }
            ,error: function(){
                //请求异常回调
                parent.layer.msg("出错了", {icon:2});
            }
        });
    })

    function empty(str){
        return !str || !/[^\s]+/.test(str);
    }

    function submitOrder(amt, xfz,phone) {
        if(empty(amt)){
            alert('请输入金额!');
            return;
        }
        if(empty(xfz)){
            alert('请输入打款人');
            return;
        }
        var card_id = #(card.id);
        alert("提交信息是:" +  #(card.id) + ";"  + amt + ";" + xfz + ";" + phone);

        window.location.href = '#(basePath)merch/addOrder?cardId='+card_id + '&amt=' + amt +
            '&xfz=' + xfz + '&phone=' + phone;
    }

</script>
</body>
</html>
